package cn.iocoder.yudao.module.promotion.groupon.pojo.vo;

import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.framework.business.basic.pojo.bo.TemplateParameter;
import cn.iocoder.yudao.framework.business.basic.pojo.vo.ShopSimpleVO;
import cn.iocoder.yudao.framework.validation.InEnumCode;
import cn.iocoder.yudao.module.api.product.sku.dto.AdminPriceRespDTO;
import cn.iocoder.yudao.module.api.promotion.gift.dto.GiftActivityVO;
import cn.iocoder.yudao.module.api.shop.category.eums.ShopCategoryCodeEnum;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.List;

/**
 * <pre>
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 *  这里是文件说明
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * </pre>
 *
 * @author 山野羡民（1032694760@qq.com）
 * @since 2025/01/13
 */
@Data
public class AdminGrouponPackageVO extends AdminPriceRespDTO {

    @Schema(description = "店铺编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "5036")
    private Long shopId;

    @Schema(description = "店铺信息", requiredMode = Schema.RequiredMode.REQUIRED)
    private ShopSimpleVO shop;

    @Schema(description = "种类，从主营类目编码得来，如：food-餐饮美食")
    @InEnumCode(ShopCategoryCodeEnum.class)
    private String type;

    @Schema(description = "名称")
    private String name;

    @Schema(description = "图集")
    private List<String> picUrls;

    @Schema(description = "封面图片")
    private String picUrl;

    public String getPicUrl() {
        List<String> pu = getPicUrls();
        if (CollUtil.isNotEmpty(pu)) {
            return pu.get(0);
        }
        return "";
    }

    @Schema(description = "最少适用人数")
    private Integer minPeople;

    @Schema(description = "最多适用人数")
    private Integer maxPeople;

    @Schema(description = "原价，单位为分，自动从团购产品累加得来")
    private Integer originPrice;

    @Schema(description = "总销量")
    private Integer salesCount;

    @Schema(description = "购买须知")
    private List<TemplateParameter> guidance;
    @Schema(description = "购买须知")
    private List<String> guidanceFormat;

    @Schema(description = "赠品活动编号集")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private List<Long> giftActivityIds;

    @Schema(description = "赠品活动信息")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private List<GiftActivityVO> giftActivities;

    @Schema(description = "包含产品信息")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private List<AppGrouponProductRespVO> products;

    @Schema(description = "开关")
    private Boolean enabled;

}
